﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SellerProject
{
    public class ShowMessages
    {
        public ShowMessages() { }

        public static void ShowMessage(string strMsg) 
        {
            System.Web.HttpContext.Current.Response.Write("<script Language='JavaScript'>window.alert('" + strMsg + "');</script>");
        }

        public static void ShowMessage(System.Web.UI.Page page, string strMsg)
        {
            page.Response.Write("<script Language='Javascript'>window.alert('" + strMsg + "');</script>");
        }
        public static void ShowMessage(string strMsg, string Url)
        {
            System.Web.HttpContext.Current.Response.Write("<script Language='Javascript'>window.alert('" + strMsg + "');window.location.href='" + Url + "'</script>");
        }
        public static void ShowMessage(System.Web.UI.Page page, string strMsg, string Url)
        {
            page.Response.Write("<script Language='Javascript'>window.alert('" + strMsg + "');window.location.href='" + Url + "'</script>");
        }
        public static void ShowConfirm(string strMsg, string strUrl_Yes, string strUrl_No)
        {
            System.Web.HttpContext.Current.Response.Write("<Script Language='JavaScript'>if(windows.confirm('" + strMsg + "')){window.location.href='" + strUrl_Yes + "'}else{windwo.location.href='" + strUrl_No + "'};");
        }
        //public static Boolean ShowConfirm(string strMsg)
        //{
        //    System.Web.HttpContext.Current.Response.Write("<script Language='JavaScript'>if(window.confirm('" + strMsg + "')){return true}else{return false};");
        //}
    }
}